var app = getApp();
Page({

  data: {
    gongGaolist: null,
    sid: null,
  },


  onLoad: function (options) {
    console.log(options);
    var that = this;
    that.setData({
      sid: app.globalData.sId
    })

    this.getGongGao(that, this.data.sid);
  },
  onPullDownRefresh: function () {
    //上拉刷新再次联网取数据
    var that = this;
    this.getGongGao(that, this.data.sid);
  },
  onshow: function () {
    var that = this;
    this.getGongGao(that, that.data.sid);
  },
  getGongGao(that, sid) {
    console.log(that)
    wx.request({
      url: `https://geek-team.xin/message/findBySId`,
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        sId: sid
      },
      success(res) {
        if (res.data != []) {
          that.setData({
            gongGaolist: res.data
          })
          console.log(res.data)
        }
      },
      fail: (e) => console.log(e)
    })
  },

})
